<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>&#39;必应翻译&#39; | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="import requestsimport json def get_response():    url &#x3D; “https:&#x2F;&#x2F;cn.bing.com&#x2F;tlookupv3?isVertical&#x3D;1&amp;&amp;IG&#x3D;E5735EB3C4FF40969C257FA39910DAF4&amp;IID&#x3D;translator.5028.4&quot;    text &#x3D; input(“当前为必应翻">
<meta property="og:type" content="article">
<meta property="og:title" content="&#39;必应翻译&#39;">
<meta property="og:url" content="http://yoursite.com/2020/04/25/%E5%BF%85%E5%BA%94%E7%BF%BB%E8%AF%91/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="import requestsimport json def get_response():    url &#x3D; “https:&#x2F;&#x2F;cn.bing.com&#x2F;tlookupv3?isVertical&#x3D;1&amp;&amp;IG&#x3D;E5735EB3C4FF40969C257FA39910DAF4&amp;IID&#x3D;translator.5028.4&quot;    text &#x3D; input(“当前为必应翻">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-04-25T03:15:32.000Z">
<meta property="article:modified_time" content="2020-04-25T03:16:05.306Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-必应翻译" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2020/04/25/%E5%BF%85%E5%BA%94%E7%BF%BB%E8%AF%91/" class="article-date">
  <time datetime="2020-04-25T03:15:32.000Z" itemprop="datePublished">2020-04-25</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      &#39;必应翻译&#39;
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>import requests<br>import json</p>
<p>def get_response():<br>    url = “<a href="https://cn.bing.com/tlookupv3?isVertical=1&amp;&amp;IG=E5735EB3C4FF40969C257FA39910DAF4&amp;IID=translator.5028.4&quot;" target="_blank" rel="noopener">https://cn.bing.com/tlookupv3?isVertical=1&amp;&amp;IG=E5735EB3C4FF40969C257FA39910DAF4&amp;IID=translator.5028.4&quot;</a><br>    text = input(“当前为必应翻译，请宁输入要翻译的内容：”)<br>    data = {<br>        “from”: “zh-Hans”,<br>        “to”: “en”,<br>        “text”: text<br>    }<br>    response = requests.post(url=url, data=data)<br>    return response.json()[0]</p>
<p>def parser(data):<br>    result = [item[“normalizedTarget”] for item in data[“translations”]]<br>    print(result)</p>
<p>def run():<br>    data = get_response()<br>    parser(data)</p>
<p>if <strong>name</strong> == “<strong>main</strong>“:<br>    run()</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2020/04/25/%E5%BF%85%E5%BA%94%E7%BF%BB%E8%AF%91/" data-id="ck9frj1jx0001hgv1esvpgipu" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2020/04/25/%E6%8F%90%E5%8F%96IP%E4%BF%A1%E6%81%AF/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          &#39;提取IP信息&#39;
        
      </div>
    </a>
  
  
    <a href="/2020/04/25/B%E7%AB%99%E8%AF%84%E8%AE%BA/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">&#39;B站评论&#39;</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/02/">February 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/04/25/%E7%AC%94%E8%AE%B0/">&#39;笔记&#39;</a>
          </li>
        
          <li>
            <a href="/2020/04/25/%E6%8F%90%E5%8F%96IP%E4%BF%A1%E6%81%AF/">&#39;提取IP信息&#39;</a>
          </li>
        
          <li>
            <a href="/2020/04/25/%E5%BF%85%E5%BA%94%E7%BF%BB%E8%AF%91/">&#39;必应翻译&#39;</a>
          </li>
        
          <li>
            <a href="/2020/04/25/B%E7%AB%99%E8%AF%84%E8%AE%BA/">&#39;B站评论&#39;</a>
          </li>
        
          <li>
            <a href="/2020/04/25/B%E7%AB%99%E8%AF%84%E8%AE%BA-ruquests%E2%80%99/">&#39;B站评论_ruquests’</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




  </div>
</body>
</html>